#include <stdio.h>
#include <iostream>
using namespace std;
typedef int *IntPtrType;


int main()
{
	IntPtrType ptr_a, ptr_b, *ptr_c;
	ptr_a = new int;// cap phap mot phan tu cho con tro ptr_a
	*ptr_a = 3;// *ptr_a  nhan gia tri la 3
	ptr_b = ptr_a;// ptr_b ---> 3
	cout << *ptr_a << " " << *ptr_b << "\n";// *ptr_a = 3; *ptr_b = 3
	ptr_b = new int;//cap phap cho con tro ptr_b
	*ptr_b = 9;// *ptr_b nhan gia tri la 9
	cout << *ptr_a << " " << *ptr_b << "\n";//*ptr_a = 3; *ptr_b = 9
	*ptr_b = *ptr_a;//*ptr_b ----> 3 
	cout << *ptr_a << " " << *ptr_b << "\n";//*ptr_a = 3; *ptr_b = 3
	delete ptr_a;// huy phan tu ptr_a
	ptr_a = ptr_b;// ptr_a --> 3
	cout << *ptr_a << " " << *&*&*&*&*ptr_b << "\n";////*ptr_a = 3; *&*&*&*&*ptr_b = 3
	ptr_c = &ptr_a;// ptr_c ---->dia chi cua ptr_a (0xxx) ma ptr_a = 3 nen *ptr_c = 3
	cout << *ptr_c << " " << **ptr_c << "\n";//ptr_c = 3; **ptr_c = 0xxx cua dia chi a
	delete ptr_a;
	ptr_a = NULL;
	system("pause");
}